objs = start.o led.o uart.o  main.o init.o exception.o interrupt.o timer.o \
	nor_flash.o my_printf.o string_utils.o lib1funcs.o nand_flash.o

objs += lcd/font.o
objs += lcd/framebuffer.o
objs += lcd/geometry.o
objs += lcd/lcd.o
objs += lcd/lcd_3.5.o
objs += lcd/lcd_controller.o
objs += lcd/lcd_test.o
objs += lcd/s3c2440_lcd_controller.o

all: $(objs)
	arm-linux-ld -T sdram.lds $^ libgcc.a -o 2440.elf
	arm-linux-objcopy -O binary -S 2440.elf 2440.bin
	arm-linux-objdump -D 2440.elf > 2440.dis

%.o : %.c
	arm-linux-gcc -march=armv4 -c -o  $@ $<

%.o : %.S
	arm-linux-gcc -march=armv4 -c -o  $@ $<

clean:
	rm *.o *.bin *.elf *.dis